﻿ <!-- based on http://www.geekchamp.com/articles/using-dockpanel-in-wp7 -->  
  
  <phone:PhoneApplicationPage 
    x:Class="DockPanelSample.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:dock="clr-namespace:System.Windows.Controls;assembly=DockPanel"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    Background="{StaticResource PhoneBackgroundBrush}"
    SupportedOrientations="Portrait, Landscape" Orientation="Portrait"
    shell:SystemTray.IsVisible="True">

  <!--LayoutRoot is the root grid where all page content is placed-->
  <Grid x:Name="LayoutRoot">
    <Grid.RowDefinitions>
      <RowDefinition Height="*"/>
    </Grid.RowDefinitions>

    <!--ContentPanel - place additional content here-->
    <Grid x:Name="ContentPanel" Grid.Row="0" Margin="12,0,12,0">
      <dock:DockPanel LastChildFill="True">
        <Button Content="Top" dock:DockPanel.Dock="Top"/>
        <Button Content="Bottom" dock:DockPanel.Dock="Bottom"/>
        <Button Content="Left" dock:DockPanel.Dock="Left"/> <!-- WORKS OK IN DESIGNER, BUT LAYS OUT WRONG AT EMULATOR AND PHONE IF THIS LINE ISN'T COMMENTED OUT -->
        <Button Content="Right" dock:DockPanel.Dock="Right"/>
        <Button Content="Middle"/>
      </dock:DockPanel>
    </Grid>

  </Grid>

</phone:PhoneApplicationPage>